import Vue from 'vue'
import Router from 'vue-router'
const index = r => require.ensure([], () => r(require('../components/index.vue')), 'pages')
const antSqDateBatch = r => require.ensure([], () => r(require('../components/ant/sq/dateBatch')), 'pages')
const antSqRealTime = r => require.ensure([], () => r(require('../components/ant/sq/realTime')), 'pages')
Vue.use(Router)

const route = new Router({
  mode: 'history',
  base: 'auto-test',
  routes: [
    {
      path: '/',
      name: 'home',
      redirect: '/index'
    },
    {
      path: '/index',
      name: 'index',
      component: index
    },
    {
      path: '/',
      name: 'index',
      component: index,
      children: [
        // {path: 'assignApplication', component: assignApplication, name: 'assignApplication', title: '指派申请'},
        {path: 'ant_sq_date_batch', component: antSqDateBatch, name: 'antSqDateBatch', title: '蚂蚁首期日结'},
        {path: 'ant_sq_real_time', component: antSqRealTime, name: 'antSqRealTime', title: '蚂蚁首期实时'}
      ]
    }
  ]
})
route.beforeEach((to, from, next) => {
  if (to.title) {
    document.title = to.title
  }
  next()
})
export default route
